﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AcctrueWMS.Foundation.WebControls
{
    public class AccTextArea : AccControl
    {
        public override string Render()
        {
            base.Render();
            StringBuilder sb = new StringBuilder();
            sb.Append("<nobr>");
            sb.Append("<textarea wrap=\"hard\" style=\"height:80px;width:90%;word-wrap: break-word; word-break: break-all;\"");
            sb.Append(GenerateBasicProperty());
            sb.Append(GenerateStyle());//增加高度宽度样式
            sb.Append(" >");
            sb.Append(GetControlValue());
            sb.Append("</textarea>");
            if (this.Musted)
            {
                sb.Append("<font style='color:red'>*</font>");
            }
            sb.Append("</nobr>");
            return sb.ToString();
        }
        /// <summary>
        /// 高度宽度样式
        /// </summary>
        /// <returns></returns>
        private string GenerateStyle()
        {
            StringBuilder sb = new StringBuilder();
            Style = "font-size:	9pt;width:90%;height:100%;border:1px solid #7b9ebd;";
            sb.Append(string.Format(" style=\"{0}\"", Style));
            //sb.Append(" style='width:" + this.Width + ";");
            //sb.Append(" height:" + this.Height + ";' ");
            return sb.ToString();
        }
    }
}

